import java.io.PrintWriter;
import java.net.Socket;

public class Listener extends Thread
{
    @Override
    public void run()
    {
        try{
	       	
	       	Socket socket = Server.listener.accept();
	       	Thread t = new Listener();
	       	t.start();
	       	System.out.println("new thread");
	       	while (true) {
       			PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
       			out.println(Server.buffer);
       			System.out.println(Server.buffer);
       			//System.out.println("written");
    			Thread.sleep(1000);
	       	}
        } catch (Exception e){
        	
        }
    }

}
